// Resets button styles
button {
  @extend %smart-focus-outline;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 14px;
  appearance: none;
  vertical-align: baseline;

  svg {
    cursor: pointer;
  }
}

// Generic button base class
// Can be used by itself, or in conjunction with the .button-* modifier classes
.button {
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
  overflow: hidden;
  text-decoration: none;
  vertical-align: top;
  transition: $anim-fast;
  -webkit-tap-highlight-color: transparent;
  background: transparent;
  border-color: $studio-simplenote-blue-50;
  border-style: solid;
  border-width: 2px;
  color: $studio-simplenote-blue-50;
  font-size: 14px;
  line-height: 1.5;
  font-weight: $bold;
  border-radius: $border-radius;
  padding: 8px 12px;

  &:active,
  &.active {
    background: $studio-simplenote-blue-50;
    color: $studio-white;
  }
  &[disabled],
  &:disabled {
    opacity: 0.5;
  }
}

// Primary buttons. Solid buttons.
.button-primary {
  background: $studio-simplenote-blue-50;
  color: white;
}

// Compact buttons. Use to make buttons smaller.
.button-compact {
  padding: 0.3em 18px;
  line-height: 1.25em;
  font-size: 90%;
}

// Danger buttons
.button-danger {
  color: $studio-red-40;
  border-color: $studio-red-40;

  &:active {
    background: $studio-red-40;
    color: $studio-white;
  }
}

// Borderless buttons don't have a border or background. Use it for icon or text buttons.
.button-borderless {
  border-width: 0;
  background: transparent;

  svg[class^='icon-'] {
    transition: $anim-fast;
  }
}

.button-borderless.button-danger {
  &:active {
    color: darken($studio-red-40, 20%);
  }
}

// Segmented control wrapper
.segmented-control {
  display: flex;
  flex-direction: row;

  //Individual segmented control buttons
  .button-segmented-control {
    border-radius: 0;
    border-left-width: 0;
    padding-left: 0;
    padding-right: 0;

    &:first-child {
      border-left-width: 2px;
      border-radius: $border-radius 0 0 $border-radius;
    }

    &:last-child {
      border-radius: 0 $border-radius $border-radius 0;
    }
  }
}
